Accusoft.ImagXpress13.ActiveX
Delete Multiple Pages

The DeletePage method deletes a single page at a time. The DeletePages method allows the developer to specify the number of pages to delete.

The DeletePage method looks like this:

VB Example
Copy Code
Sub DeletePage( FileName As String, PageNbr As Long )

The DeletePages method looks like this:

VB Example
Copy Code
Sub DeletePage( FileName As String, PageNbr As Long, NumPages As Long )

Deleting the First Three Pages in a TIFF Document

Using DeletePage to delete the first 3 pages in a multipage TIFF document requires code similar to this:

 
Copy Code
Dim i As Integer
For i = 1 To 3
    ImagXpress1.DeletePage filename, 1
Next

Using DeletePages, the previous example is done like this:

 
Copy Code
ImagXpress1.DeletePages filename, 1, 3

Deleting the Last Three Pages in a TIFF Document

Using DeletePage to delete the last 3 pages in a multipage TIFF document requires code similar to this:

 
Copy Code
Dim numberOfPagesInDocument As Long
Dim pageToDelete As Long
Dim i As Integer
numberOfPagesInDocument = ImagXpress1.NumPages(filename)
pageToDelete = numberOfPagesInDocument - 2
For i = 1 To 3
   ImagXpress1.DeletePage filename, pageToDelete
Next

Using DeletePages, the previous example is done like this:

 
Copy Code
Dim numberOfPagesInDocument As Long
Dim startPageToDelete As Long
numberOfPagesInDocument = ImagXpress1.NumPages(filename);
startPageToDelete = numberOfPagesInDocument - 2;
ImagXpress1.DeletePages filename, startPageToDelete, 3

 

 


©2018. Accusoft Corporation. All Rights Reserved.

Send Feedback